﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Web;
using Itop.GpsCar.Model;
using Itop.GpsCar.Web;
using Ext.Net;

namespace Web.Admin.Core {
    public partial class UserTreeMgr : WMS_UI {

        protected void GetUserNodes(object sender, NodeLoadEventArgs e) {
            IList<user> list = Global.SqlMapper.GetList<user>("where puserid='" + (e.NodeID == "root" ? "0" : e.NodeID) + "'");
            foreach (user user in list) {
                e.Nodes.Add(new Ext.Net.TreeNode() { NodeID = user.userid.ToString(), Href = "", Text = user.username, Icon = Icon.User });
            }
            
            //e.Nodes.Add(new Ext.Net.TreeNode() { NodeID = "1", Href = "core/usermgr.aspx", Text = "客户管理", Icon = Icon.UserHome });
        }
        
    }

}
